package com.evola.dbsm.service
{
	
	import com.evola.dbsm.communication.CommandObject;
	import com.evola.dbsm.communication.CommandObjectFactory;
	
	import mx.collections.ArrayList;
	import mx.collections.IList;

	public class RemoteServiceFacade
	{
		private static var remoteService:RemoteService=new RemoteService();

		public static function executeCommand(commandName:String, data:Object, onResult:Function, onFault:Function=null):void
		{
			var commands:IList=new ArrayList();
			var command:CommandObject=CommandObjectFactory.createCommandObject(commandName, data);
			commands.addItem(command);
			remoteService.executeRemoteMethod(onResult, onFault, commands);
		}
		
		public static function test(input:String, onResult:Function, onFault:Function=null):void
		{
			remoteService.executeTest(input, onResult, onFault);
		}

		public static function executeCommands(commandWrapper:CommandWrapper, onResult:Function, onFault:Function=null):void
		{
			remoteService.executeRemoteMethod(onResult, onFault, commandWrapper.getCommands());
		}
		
		
	}
}